package Day07数组;

public class ShuZu06 {
    public static void main(String[] args) {
        //求总分平均分
        int[] arr = new int[]{98,97,65,99,59};
        //定义变量保存总分
        int sum = 0;
        //遍历数组
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        double avg = sum / arr.length;
        System.out.println("总分是:"+sum);
        System.out.println("平均分是:"+avg);
    }
}
